package com.sc.nft.entity.dto;

import com.sc.nft.enums.TradingPoolTransactionTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@Data
public class BusinessDTO {
    @ApiModelProperty("交易池id")
    @NotNull(message = "交易池id不能为空")
    private Long id;

    @ApiModelProperty("dao 标识")
    @NotNull(message = "dao 标识不能为空")
    private Long daoId;

    @ApiModelProperty("买卖类型")
    @NotNull(message = "买卖类型不能为空")
    private TradingPoolTransactionTypeEnum type;

    @ApiModelProperty("最大涨幅")
    @NotNull(message = "最大涨幅不能为空")
    private BigDecimal maxIncreasePercentage;

    @ApiModelProperty("最大跌幅")
    @NotNull(message = "最大跌幅不能为空")
    private BigDecimal maxDecreasePercentage;

    @ApiModelProperty( "支付密码")
    @NotNull(message = "支付密码不能为空")
    private String dealPwd;

    @ApiModelProperty("前端显示价格")
    @NotNull(message = "前端显示价格不能为空")
    private BigDecimal presentPrice;


    public void setMaxIncreasePercentage(BigDecimal maxIncreasePercentage) {
        this.maxIncreasePercentage = maxIncreasePercentage.movePointLeft(2);
    }

    public void setMaxDecreasePercentage(BigDecimal maxDecreasePercentage) {
        this.maxDecreasePercentage = maxDecreasePercentage.movePointLeft(2);
    }
}
